<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!Doctype html>
<html>
<head>
    <meta content="text/html" charset="utf-8">
    <title>党建</title>
    <meta name="keywords" content="务川,党建"/>
    <meta name="description" content="务川,党建"/>
    <link href="../../static/images/ico/favicon.png" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="../../static/css/article.css">
    <script type="text/javascript" src="../../static/js/user/jq181.js"></script>


    <link rel="stylesheet" type="text/css" href="../../static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../../static/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="../../static/css/grumble.css">

    <script type="text/javascript" src="../../static/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../../static/js/bootstrap.js"></script>
    <script type="text/javascript" src="../../static/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="../../static/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script type="text/javascript" src="../../static/js/jquery.grumble.min.js"></script>
    <script type="text/javascript" src="../../static/js/zhBase.js"></script>
    <script type="text/javascript" src="../../static/js/zhForm.js"></script>

    <script>
        $(function () {
            /**
             * 提交后的响应函数
             * @param data 服务器返回
             */
            function deal(data) {
                if("1"==data.status){
                    alert("保存成功");
                    window.location.href="/apply/myApply.do";
                }
                else{
                    alert("保存失败");
                }
            }

            var zf = new zhForm($("#formId"));
            $("#btnid").click(function () {
                var isSuccess = zf.verify();
                if (isSuccess) {
                    zf.submitForm(deal);
                }
            });

            //初始化时间插件
            $('.form_datetime').datetimepicker({
                format: 'yyyy-mm-dd',
                language: 'zh-CN',
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                minView: 2,
                forceParse: 0
            }).click(function () {
                $(this).val("");
            });
        });
    </script>

</head>
<body>
<jsp:include page="../../themes/header.jsp"/>
<div id="middle">
    <div class="wrapper">
        <div id="middle-content">
            <div class="article-wrapper">
                <div class="article-header">
                    <div>
                        <span></span>当前位置：<a href="/">首页</a> &gt; <a href="/apply/myApply.do">我的申请</a> &gt; <a href="#">申请新活动</a>
                    </div>
                </div>
                <div class="article-content-wrapper">
                    <form action="/apply/addData.do" id="formId" class="form-horizontal" role="form">
                        <div class="row">
                            <div class="col-xs-8">
                                <div class="form-group">
                                    <label for="title" class="col-sm-3 control-label">活动名称</label>

                                    <div class="col-sm-9">
                                        <input name="title" value="" type="text" notNull="true" class="form-control" id="title" placeholder="活动名称">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-xs-8">
                                <div class="form-group">
                                    <label for="money" class="col-sm-3 control-label">活动经费(元)</label>

                                    <div class="col-sm-9">
                                        <input name="money" value="" type="text" isNumber="true" class="form-control" id="money"
                                               placeholder="活动经费">
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-xs-8">
                                <div class="form-group">
                                    <label for="timeBegin" class="col-sm-3 control-label">活动开始时间</label>
                                    <div class="col-sm-9">
                                        <input type="text" value="" name="timeBegin" id="timeBegin" readonly class="form_datetime form-control">

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-8">
                                <div class="form-group">
                                    <label for="timeEnd" class="col-sm-3 control-label">活动结束时间</label>
                                    <div class="col-sm-9">
                                        <input type="text" value="" name="timeEnd" id="timeEnd" readonly class="form_datetime form-control">

                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <label for="meaning" class="col-sm-2 control-label">活动意义</label>

                                    <div class="col-sm-9">
                                        <textarea name="meaning" class="form-control" notNull="true" id="meaning" rows="3"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="form-group">
                                    <label for="content" class="col-sm-2 control-label">活动简介</label>

                                    <div class="col-sm-9">
                                        <textarea name="content" class="form-control" notNull="true" id="content" rows="3"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-xs-2">
                            </div>
                            <div class="col-xs-4">
                                <button type="button" id="btnid" class="btn btn-success btn-block">提交</button>
                            </div>
                            <div class="col-xs-2">
                            </div>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>

<c:if test="${empty sessionScope.sysUser}">
    <script type="text/javascript">
        alert("亲爱的用户，请先登录");
        window.location.href="/loginReg/login.do";
    </script>
</c:if>
<jsp:include page="../../themes/footer.jsp"/>
</body>
</html>